package org.fxcontainer.commands.navigation.chain
{

	import com.developmentarc.core.actions.commands.AbstractCommand;

	public class ControlQueue
	{
		
		public function ControlQueue(_navURL:NavigationURL, _command:AbstractCommand)
		{
			this.navURL = _navURL;
			this.command = _command;
		}
		
		private var command:AbstractCommand;
		
		private var navURL:NavigationURL;
		
		public function dispatch():void
		{
			//command should be of URLChangeCommand
			command.dispatch();
		}
		
		public function touchControl(controlName:String, methodName:String=null, ... args:Array):ControlQueue
		{
			navURL.touchControl(controlName, methodName, args!=null?args[0]:args);
			return this;
		}

	}
}